<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>登录 - {:sysconfig('im','title')}</title>
  <script src="/qstatic/js/layui.js"></script>
  <link rel="stylesheet" href="/qstatic/js/css/layui.css" />
  <script src="/qstatic/js/jquery-1.9.1.min.js"></script>
</head>
<body>
<style>
.demo-login-container{width: 320px; margin: 21px auto 0;}
.demo-login-other .layui-icon{position: relative; display: inline-block; margin: 0 2px; top: 2px; font-size: 26px;}
</style>
<div class="layui-form">
  <div class="demo-login-container">
      <div style="margin: 2.5rem 0rem 0rem 0rem;font-size: 2rem;color: #16baaa;">登录</div>
      {if sysconfig('game','gamelogin') != '0'}
      <div style="margin: 0rem 0rem 1rem 0rem;font-size: 1rem;color: #999;">账号和游戏同步,无需重复注册</div>
      {else/}
      <div style="margin: 0rem 0rem 1rem 0rem;font-size: 1rem;color: #999;">LOGIN</div>
      {/if}
    <div class="layui-form-item">
      <div class="layui-input-wrap">
        <div class="layui-input-prefix">
          <i class="layui-icon layui-icon-username"></i>
        </div>
        <input type="text" name="account" value="" lay-verify="required" placeholder="用户名" lay-reqtext="请填写用户名" autocomplete="off" class="layui-input" lay-affix="clear">
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-input-wrap">
        <div class="layui-input-prefix">
          <i class="layui-icon layui-icon-password"></i>
        </div>
        <input type="password" name="password" value="" lay-verify="required" placeholder="密   码" lay-reqtext="请填写密码" autocomplete="off" class="layui-input" lay-affix="eye">
      </div>
    </div>
    
    <div class="layui-form-item">
      <!--<a href="#forget" style="float: right; margin-top: 7px;">忘记密码？</a>-->
    </div>
    <div class="layui-form-item">
      <button class="layui-btn layui-btn-fluid" style="border-radius: 1.07rem;" onclick="submit()">登录</button>
    </div>
    <div class="layui-form-item demo-login-other">
        <a class="layui-btn layui-btn-fluid" style="border-radius: 1.07rem;"  href="/login/reg">注册</a>
    </div>
  </div>
</div>
  
<script type="text/javascript">

	    function submit(){
	        var load = layer.load();
	        $.post("/login/login", {
                account: $('input[name="account"]').val(),  
                password: $('input[name="password"]').val() 
            }, function(data, status) {
                layer.close(load);
                if(data.code != 1){
                    layer.msg(data.msg, {icon: 2}, function(){
                        // layer.msg('提示框关闭后的回调');
                    });
                }else{
                    layer.msg(data.msg, {icon: 1,time:1000}, function(){
                        window.location.href = data.url;
                    });
                }

            });
	    }
</script>

</body>
</html>